<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>局部指令</title>
</head>
<body>

<div id="app">
  <input type="text" v-focus>
</div>


<script src="../lib/vue.js"></script>
<script>
  let vm = new Vue({
    el: '#app',
    directives: {
      focus: {
        inserted(el) {
          el.focus();
        }
      }
    }
  })
</script>

</body>
</html>